/*   1:    */package com.mrd.packet;
/*   2:    */
/*   7:    */import org.slf4j.Logger;
/*   8:    */import org.slf4j.LoggerFactory;
/*   9:    */
/*  18:    */public abstract class Packet
/*  19:    */{
/*  20: 20 */  private static final Logger log = LoggerFactory.getLogger(Packet.class);
/*  21:    */  
/*  23: 23 */  protected static PacketType packetType = null;
/*  24:    */  public abstract Object getData();
/*  25:    */  
/*  26: 26 */  public static enum PacketType { STRING,  JSON,  PB;
/*  27:    */    
/*  28:    */    private PacketType() {} }
/*  29: 29 */  private int packetId = 0;
/*  30:    */  
/*  31: 31 */  private long stamp = 0L;
/*  32:    */  
/*  33: 33 */  private int retCode = 0;
/*  34:    */  
/*  35: 35 */  private int flag = 0;
/*  36:    */  
/*  40:    */  public abstract void setData(Object paramObject);
/*  41:    */  
/*  44:    */  public int getRetCode()
/*  45:    */  {
/*  46: 46 */    return this.retCode;
/*  47:    */  }
/*  48:    */  
/*  49: 49 */  public void setRetCode(int retCode) { this.retCode = retCode; }
/*  50:    */  
/*  51:    */  public int getPacketId()
/*  52:    */  {
/*  53: 53 */    return this.packetId;
/*  54:    */  }
/*  55:    */  
/*  56: 56 */  public void setPacketId(int packetId) { this.packetId = packetId; }
/*  57:    */  
/*  58:    */  public long getStamp() {
/*  59: 59 */    return this.stamp;
/*  60:    */  }
/*  61:    */  
/*  62: 62 */  public void setStamp(long stamp) { this.stamp = stamp; }
/*  63:    */  
/*  64:    */  public int getFlag()
/*  65:    */  {
/*  66: 66 */    return this.flag;
/*  67:    */  }
/*  68:    */  
/*  69: 69 */  public void setFlag(int flag) { this.flag = flag; }
/*  70:    */  
/*  71:    */  public static PacketType getPacketType()
/*  72:    */  {
/*  73: 73 */    return packetType;
/*  74:    */  }
/*  75:    */  
/* 248:    */  
/* 253:    */  public static Packet newPbPacket(int packetId, Object data)
/* 254:    */  {
/* 255:255 */    Packet result = new PbPacket();
/* 256:256 */    result.setPacketId(packetId);
/* 257:257 */    result.setData(data);
/* 258:258 */    return result;
/* 259:    */  }

/* 272:    */  
/* 273:    */  public String toString()
/* 274:    */  {
/* 275:275 */    return "Packet [packetId=" + this.packetId + ", stamp=" + this.stamp + ", retCode=" + this.retCode + ", flag=" + this.flag + " data =" + getData() + "]";
/* 276:    */  }
/* 277:    */}

